{% extends "layouts/base.html" %}
{% load i18n %}

{% block content %}
<div class="container py-5">
  <h3 class="fw-bold mb-4">
    <i class="bi bi-clock-history me-2"></i>{% trans "Histórico de Compras" %}
  </h3>

  {% if purchases %}
  <div class="list-group">
    {% for p in purchases %}
    <div class="list-group-item d-flex justify-content-between align-items-center">
      <div>
        <h5 class="fw-bold mb-1">{{ p.character_name }}</h5>
        <small class="text-muted">{{ p.data_compra|date:"d/m/Y H:i" }}</small>
      </div>
      <span class="fw-semibold text-success">R$ {{ p.total_pago|floatformat:2 }}</span>
    </div>
    {% endfor %}
  </div>
  {% else %}
  <p>{% trans "Nenhuma compra realizada ainda." %}</p>
  {% endif %}
</div>
{% endblock %}
